package com.lb.jwitter.service;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lb.jwitter.*;
import com.lb.jwitter.hibernate.*;
import com.lb.jwitter.util.ConditionReport;

@Service("tbl_QLDTTXA_DM_TrangThaiHocVienService")
@Transactional
@WebService(endpointInterface = "com.lb.jwitter.service.Tbl_QLDTTXA_DM_TrangThaiHocVienService")
public class Tbl_QLDTTXA_DM_TrangThaiHocVienServiceImpl implements Tbl_QLDTTXA_DM_TrangThaiHocVienService,Serializable {

   private Log log = LogFactory.getLog(Tbl_QLDTTXA_DM_TrangThaiHocVienServiceImpl.class);
   private static final long serialVersionUID = -8740095022264495229L;

   @Autowired
   @Qualifier("tbl_QLDTTXA_DM_TrangThaiHocVienDAO")
   private Tbl_QLDTTXA_DM_TrangThaiHocVienDAO _tbl_QLDTTXA_DM_TrangThaiHocVienDao;

   public final List<Tbl_QLDTTXA_DM_TrangThaiHocVien> findAlltbl_QLDTTXA_DM_TrangThaiHocVien(int pageSize, int page){
   List<Tbl_QLDTTXA_DM_TrangThaiHocVien> result = get_tbl_QLDTTXA_DM_TrangThaiHocVienDao().findAll(pageSize, page);
       log.info("Number of user in DB:: "+result.size());
       return result;
   }

   @Transactional(noRollbackFor=IllegalArgumentException.class)
   public final Long createtbl_QLDTTXA_DM_TrangThaiHocVien(Tbl_QLDTTXA_DM_TrangThaiHocVien obj){
       return _tbl_QLDTTXA_DM_TrangThaiHocVienDao.save(obj);
   }

   public final void updatetbl_QLDTTXA_DM_TrangThaiHocVien(Tbl_QLDTTXA_DM_TrangThaiHocVien obj){
       _tbl_QLDTTXA_DM_TrangThaiHocVienDao.update(obj);
   }//end update methode

   public final Tbl_QLDTTXA_DM_TrangThaiHocVien gettbl_QLDTTXA_DM_TrangThaiHocVien (Long id){
       log.info("Try to retrieve the tbl_QLDTTXA_DM_TrangThaiHocVien: "+id);
       return get_tbl_QLDTTXA_DM_TrangThaiHocVienDao().get(id);
   }

   public void deletetbl_QLDTTXA_DM_TrangThaiHocVien(Long id){
       log.info("Try to delete the tbl_QLDTTXA_DM_TrangThaiHocVien by Id : "+ id);
       if(_tbl_QLDTTXA_DM_TrangThaiHocVienDao.exists(id)){
	    _tbl_QLDTTXA_DM_TrangThaiHocVienDao.delete(id);
       } else {
       	throw new IllegalArgumentException("EmployeeId '"+id+"' does not exists");
       }
   }

   public void deleteListtbl_QLDTTXA_DM_TrangThaiHocVien(String[] listId){
       for(String id : listId){
   	    deletetbl_QLDTTXA_DM_TrangThaiHocVien(Long.parseLong(id));
       }
   }

   public List<Tbl_QLDTTXA_DM_TrangThaiHocVien> findtbl_QLDTTXA_DM_TrangThaiHocVienByCondition(List<ConditionReport> cons,int pageSize,int page){ 
       return _tbl_QLDTTXA_DM_TrangThaiHocVienDao.findByCondition(Tbl_QLDTTXA_DM_TrangThaiHocVien.class, cons, pageSize, page); 
   } 
 
   public int counttbl_QLDTTXA_DM_TrangThaiHocVienByCondition(List<ConditionReport> cons){ 
       return _tbl_QLDTTXA_DM_TrangThaiHocVienDao.countByCondition(Tbl_QLDTTXA_DM_TrangThaiHocVien.class, cons); 
   } 
 
   public final Tbl_QLDTTXA_DM_TrangThaiHocVienDAO get_tbl_QLDTTXA_DM_TrangThaiHocVienDao() {
   	return _tbl_QLDTTXA_DM_TrangThaiHocVienDao;
   }
   public final void set_tbl_QLDTTXA_DM_TrangThaiHocVienDao(Tbl_QLDTTXA_DM_TrangThaiHocVienDAO obj) {
   	this._tbl_QLDTTXA_DM_TrangThaiHocVienDao = obj;
   }

}//endclass

